<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('menu/index')}">{:L('ADMIN_MENU_INDEX')}</a></li>
			<li><a href="{:U('menu/add')}">{:L('ADMIN_MENU_ADD')}</a></li>
			<li class="active"><a href="{:U('menu/edit', array('id' => I('request.id/s',''), 'menuid' => I('request.menuid/s')))}">编辑菜单</a></li>
		</ul>

        <form method="post" class="form-horizontal js-ajax-form" action="{:U('Menu/edit_post')}">
            <div class="form-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">上级</label>
                            <div class="col-md-9">
                                <select name="parentid" class="form-control">
                                    <option value="0">作为一级菜单</option>{$select_categorys}
                                </select>
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">
                                名称
                                <span class="required" aria-required="true"> * </span>
                            </label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="name" value="{$data.name}">
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">
                                应用
                                <span class="required" aria-required="true"> * </span>
                            </label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="app" id="app"  value="{$data.app}">
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">
                                状态
                                <span class="required" aria-required="true"> * </span>
                            </label>
                            <div class="col-md-9">
                                <select name="status" class="form-control">
                                    <option value="1">显示</option>
                                    <php>$status_selected=empty($data['status'])?"selected":"";</php>
                                    <option value="0" {$status_selected}>隐藏</option>
                                </select>
                               
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">
                                控制器
                                <span class="required" aria-required="true"> * </span>
                            </label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="model" id="model" value="{$data.model}">
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">
                                方法
                                <span class="required" aria-required="true"> * </span>
                            </label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="action" id="action" value="{$data.action}">
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">
                                参数
                            </label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="data" value="{$data.data}">
                                <span class="help-block">
                                    例:id=3&p=3
                                </span>
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">图标</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="icon" id="action"  value="{$data.icon}">
                                <span class="help-block">
                                    <a href="http://www.thinkcmf.com/font/icons" target="_blank">选择图标</a> 不带前缀fa-，如fa-user => user
                                </span>
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">类型</label>
                            <div class="col-md-9">
                                <select name="type" class="form-control">
                                    <option value="1">权限认证+菜单</option>
                                    <php>$type_selected=empty($data['type'])?"selected":"";</php>
                                    <option value="0" {$type_selected}>只作为菜单</option>
                                </select>
                                <span class="help-block">
                                    注意：“权限认证+菜单”表示加入后台权限管理，纯碎是菜单项请不要选择此项。
                                </span>
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-2">备注</label>
                            <div class="col-md-9">
                                <textarea name="remark" style="height:50px;" class="form-control">
                                    {$data.remark}
                                </textarea>
                            </div>
                        </div>
                    </div>
                    <!--/span-->
                </div>
                <div class="row">
                    <div class="col-md-12">
                    </div>
                    <!--/span-->
                </div>
            </div>
            <div class="form-actions col-md-10 col-md-offset-2">
                <input type="hidden" name="id" value="{$data.id}" />
                <button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
                <a class="btn btn-default" href="javascript:history.back(-1);">{:L('BACK')}</a>
            </div>
        </form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$(function() {
			$(".js-ajax-close-btn").on('click', function(e) {
				e.preventDefault();
				Wind.use("artDialog", function() {
					art.dialog({
						id : "question",
						icon : "question",
						fixed : true,
						lock : true,
						background : "#CCCCCC",
						opacity : 0,
						content : "您确定需要关闭当前页面嘛？",
						ok : function() {
							setCookie('refersh_time_admin_menu_index', 1);
							window.close();
							return true;
						}
					});
				});
			});
		});
	</script>
</body>
</html>